<script>
    var s1 = prompt('请输入任意字符')
    l = 0
    r = s1.length - 1
    s2 = s1.split('')
    alert(s2)
    s2 = s1.toLowerCase().split('')
    alert(s2)
    s2[0] = s1[0].toUpperCase().split('')
    alert(s2)
    s2[r = s1.length - 1] = s1[r].toUpperCase().split('')
    alert(s2)
    while (l < r) {
        cup = s2[l]
        s2[l] = s2[r]
        s2[r] = cup
        l++
        r--
    }
    alert(s2)
</script>